-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { var r = (d + Math.random()*16)%16 | 0; d = Math.floor(d/16); return (c=='x' ? r : (r0x3|0x8)).toString(16);});return uuid;};
The following comments: the collision rate in this solution is less than 1/2 ^ 122
In addition, we recommend several algorithms.
Algorithm 2
function guid() { return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, functi
A globally unique identifier (guid,globally unique Identifier) is also known as a UUID (universally unique Identifier).
A GUID is a 128-bit numeric identifier generated by the algorithm in binary length. The GUID is formatted as "Xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", where X is a 32-bit hexadecimal number in the range 0-9 or a-f. Ideally, no computer or cluster of computers will generate two identical GUIDs.
The total number of GUIDs reached 2^128 (3.4x10^38), so the probability of randomly g
Javascript to generate a globally unique identifier (GUID, UUID), guiduuid
A Globally Unique Identifier (GUID, Globally Unique IDentifier) is also called a UUID (Universally Unique Identifier ).
GUID is a 128-bit numeric identifier generated by an algorithm. The GUID format is "xxxxxxxx-xxxx-xxxxxxxxxxxx", where x is a 32-bit hexadecimal number in the range of 0-9 or a-f. Ideally, no computer or computer cluster generates two identical guids.
The total number of guids reaches 2 ^ 128 (3.4 × 10 ^
until_log_file:until_log_pos:0
Master_ssl_allowed:no Master_SSL_CA_File:Master_SSL_CA_Path:Master_SSL_Cert: master_ssl_cipher:master_ssl_key:seconds_behind_master:0 7, verify the master-slave synchronization effect. Judge by creating a new database on the primary server and then checking to see if the synchronization was successful. Databases in the primary server mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| my
); // bits 6-7 of the clock_seq_hi_and_reserved to 01S [8] = s [13] = s [18] = s [23] = "-";Var uuid = s. join ("");Return uuid;}
Algorithm 2
The Code is as follows:
Function guid (){Return 'xxxxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx '. replace (/[xy]/g, function (c ){Var r = Math. random () * 16 | 0, v = c = 'X '? R: (r 0x3 | 0x8 );Return v. toString (16 );});}
Algorithm 3
The Code is as follows:
Function guid (){Function S4 (){Return (1 + Math. ra
assigns the value of X+y to XX-=y assigns X-y values to X.X*=y assigns the value of X*y to XX/=y assigns the value of x/Y to X%=y to assign the value of X%y to XX^=y assigns the value of X^y to XX**=y assigns the value of X**y to XC. Tests allowed by awk:operator meaningX==y x equals yX!=y x not equal to YX>y x greater than YX>=y x is greater than or equal to YXXX~re x matches regular expression re?X!~re X does not match regular expression re?D. awk
someone encounters a bug or is inconvenient to use, you are welcome to raise it so that you can continue to improve it.
I hope you will forgive me for any shortcomings in the plug-ins written after learning.
Finally, I would like to thank my friends who have helped and answered my questions during the development of this plug-in. In particular, I would like to thank Mr. Delevin for his great encouragement!
If you don't talk nonsense, add the js Code and
I. Html + Css
Ii. Jquery
$. Fn. extend (
in this plugin development process. Thank you especially for Mr. Delevin's great doubts!
No more nonsense, attached JS code and download address
First, Html+css
Two, Jquery
$.fn.extend ({generateuuid:function () {//Unique ID value generates var d = new Date (). GetTime (); var uuid = ' xxxxxxxx-xxxx-4xxx-yxxx-xx Xxxxxxxxxx '. Replace (/[xy]/g, function (c) {var r = (d + math.random () *)% | 0; d = Math.floor (D/16); return (c = = '
Contact Us
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.